<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps API Sample</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<<INSERT KEY>>"></script>
    <script type="text/javascript">

    var map;
    var geoXml; 
    var toggleState = 1;
    
    function initialize() {
      if (GBrowserIsCompatible()) {
        geoXml = new GGeoXml("http://mapgadgets.googlepages.com/cta.kml");
        map = new GMap2(document.getElementById("map_canvas")); 
        map.setCenter(new GLatLng(41.875696,-87.624207), 11); 
        map.addControl(new GLargeMapControl());
        map.addControl(new GLargeMapControl());
        map.addOverlay(geoXml);
      }
    } 
    
    function toggleMyKml() {
      if (toggleState == 1) {
        map.removeOverlay(geoXml);
        toggleState = 0;
      } else {
        map.addOverlay(geoXml);
        toggleState = 1;
      }
    }

    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border: 0 none;">
    <div id="map_canvas" style="width: 100%; height: 480px; float:left; border: 1px solid black;"></div>
  </div>
  <br clear="all"/>
  <br/>
  <input type="button" value="Toggle KML" onClick="toggleMyKml();"/>
  </body>
</html>